﻿guestBookApp.factory('DataService',
    ["$http",
    function ($http) {

    var addNewRecord = function (record) {
        return $http.post("api/GuestBook/PostRecord", record);
    };

    var getRecords = function () {
        return $http.get("api/GuestBook");
    }

    var removeRecord = function (id) {
        return $http.delete("api/GuestBook/" + id);
    }

    return {
        addNewRecord: addNewRecord,
        getRecords: getRecords,
        removeRecord: removeRecord
    };
}]);